package com.ruoyi.system.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.WlwsysNotice;
import com.ruoyi.system.domain.SysNotice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * 通知公告表 数据层
 * 
 * @author ruoyi
 */
@Mapper
public interface SysNoticeMapper
{
    /**
     * 查询公告信息
     * 
     * @param noticeId 公告ID
     * @return 公告信息
     */
    public SysNotice selectNoticeById(Long noticeId);

    /**
     * 查询公告列表
     * 
     * @param notice 公告信息
     * @return 公告集合
     */
    public List<SysNotice> selectNoticeList(SysNotice notice);

    /**
     * 新增公告
     * 
     * @param notice 公告信息
     * @return 结果
     */
    public int insertNotice(SysNotice notice);

    /**
     * 修改公告
     * 
     * @param notice 公告信息
     * @return 结果
     */
    public int updateNotice(SysNotice notice);

    /**
     * 批量删除公告
     * 
     * @param noticeId 公告ID
     * @return 结果
     */
    public int deleteNoticeById(Long noticeId);

    /**
     * 批量删除公告信息
     * 
     * @param noticeIds 需要删除的公告ID
     * @return 结果
     */
    public int deleteNoticeByIds(Long[] noticeIds);

    public List<SysNotice> listNoticeByType(String noticeType);

    @Select("select * from wlwsys.sys_notice where notice_type = #{noticeType} order by create_time desc")
    @Results(
            value = {
                    @Result(property = "noticeId",column = "notice_id"),
                    @Result(property = "noticeTitle",column = "notice_title"),
                    @Result(property = "noticeType",column = "notice_Type"),
                    @Result(property = "noticeContent",column = "notice_content"),
                    @Result(property = "status",column = "status"),
                    @Result(property = "createBy",column = "create_by"),
                    @Result(property = "createTime",column = "create_time"),
                    @Result(property = "updateBy",column = "update_by"),
                    @Result(property = "updateTime",column = "update-time"),
                    @Result(property = "remark",column = "remark"),
            }
    )
    public List<WlwsysNotice> listNoticeByType1(@Param("noticeType")String noticeType);
}
